package com.example.test.mapper;

import com.example.test.entity.Notice;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface NoticeMapper {
    @Select("select  * from notices")
    List<Notice> selectAll();
    @Update("UPDATE notices SET text=#{text}, ifplay=#{ifplay} WHERE id=#{id}")
    void updateNotice(Notice notice);
    @Select("SELECT * FROM notices WHERE id=#{id}")
    Notice getNoticeById(int id);
    @Delete("DELETE FROM notices WHERE id=#{id}")
    void deleteNotice(int id);
}
